tooltip: Set icon from texture instead of pixbuf
authorMatthias Clasen <mclasen@redhat.com>
Thu, 30 Nov 2017 03:17:59 +0000 (22:17 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 30 Nov 2017 03:17:59 +0000 (22:17 -0500)
Another part of removing GdkPixbuf from APIs.

gtk/gtktooltip.c
gtk/gtktooltip.h
gtk/gtktooltipwindow.c
gtk/gtktooltipwindowprivate.h

index 81cba1d7186ba06d68d29f6eafc83ee1545e057e..dbca016ba4119c86b0e317605a88a7e8bd8175fd 100644 (file)
@@ -275,21 +275,21 @@ gtk_tooltip_set_text (GtkTooltip  *tooltip,
 /**
  * gtk_tooltip_set_icon:
  * @tooltip: a #GtkTooltip
- * @pixbuf: (allow-none): a #GdkPixbuf, or %NULL
+ * @texture: (allow-none): a #GdkTexture, or %NULL
  *
  * Sets the icon of the tooltip (which is in front of the text) to be
- * @pixbuf.  If @pixbuf is %NULL, the image will be hidden.
+ * @texture.  If @texure is %NULL, the image will be hidden.
  *
- * Since: 2.12
+ * Since: 3.94
  */
 void
 gtk_tooltip_set_icon (GtkTooltip *tooltip,
-                     GdkPixbuf  *pixbuf)
+                     GdkTexture *texture)
 {
   g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
-  g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
+  g_return_if_fail (texture == NULL || GDK_IS_TEXTURE (texture));
 
-  gtk_tooltip_window_set_image_icon (GTK_TOOLTIP_WINDOW (tooltip->window), pixbuf);
+  gtk_tooltip_window_set_image_icon (GTK_TOOLTIP_WINDOW (tooltip->window), texture);
 }
 
 /**
index c6a129fe600a75cbbe87b05b048982731d4b9fc6..70091f854817b69f64903f1cfec00683b589a91a 100644 (file)
@@ -41,9 +41,9 @@ void gtk_tooltip_set_markup              (GtkTooltip         *tooltip,
 GDK_AVAILABLE_IN_ALL
 void gtk_tooltip_set_text                (GtkTooltip         *tooltip,
                                           const gchar        *text);
-GDK_AVAILABLE_IN_ALL
+GDK_AVAILABLE_IN_3_94
 void gtk_tooltip_set_icon                (GtkTooltip         *tooltip,
-                                          GdkPixbuf          *pixbuf);
+                                          GdkTexture         *texture);
 GDK_AVAILABLE_IN_ALL
 void gtk_tooltip_set_icon_from_icon_name (GtkTooltip         *tooltip,
                                          const gchar        *icon_name);
index a83078217e06c153c6dd5131148ec38024bf0c56..18bcca3bc4256b0da41a190d0a3134f8b3a7db15 100644 (file)
@@ -121,12 +121,12 @@ gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
 
 void
 gtk_tooltip_window_set_image_icon (GtkTooltipWindow *window,
-                                   GdkPixbuf        *pixbuf)
+                                   GdkTexture       *texture)
 {
 
-  if (pixbuf != NULL)
+  if (texture != NULL)
     {
-      gtk_image_set_from_pixbuf (GTK_IMAGE (window->image), pixbuf);
+      gtk_image_set_from_texture (GTK_IMAGE (window->image), texture);
       gtk_widget_show (window->image);
     }
   else
index 35e9f6ee9557fba95ff30df03d121735cf3d6d38..527c3499961d926b6d7120c9167e84557ea6665e 100644 (file)
@@ -42,7 +42,7 @@ void            gtk_tooltip_window_set_label_markup             (GtkTooltipWindo
 void            gtk_tooltip_window_set_label_text               (GtkTooltipWindow *window,
                                                                  const char       *text);
 void            gtk_tooltip_window_set_image_icon               (GtkTooltipWindow *window,
-                                                                 GdkPixbuf        *pixbuf);
+                                                                 GdkTexture       *texture);
 void            gtk_tooltip_window_set_image_icon_from_name     (GtkTooltipWindow *window,
                                                                  const char       *icon_name);
 void            gtk_tooltip_window_set_image_icon_from_gicon    (GtkTooltipWindow *window,